import { getStatusName, Status } from 'constants/status';

const getStatusColor = (status: Status) => {
    if (status == Status.SENT) {
        return 'var(--color-positive)';
    } else if (status == Status.FAILED) {
        return 'var(--color-negative)';
    } else if (status == Status.PENDING) {
        return 'var(--color-warning-2)';
    } else if (status == Status.SENDING) {
        return 'var(--color-warning-2)';
    } else {
        return 'var(--color-negative)';
    }
};

const TransactionStatus = (props) => {
    return <b style={{ color: getStatusColor(props.status) }}>{getStatusName(props.status)}</b>;
};

export default TransactionStatus;
